//#include "stdafx.h"
#include "Parameter.h"
#include <cmath>

CParameter	g_Parameter;

#ifndef M_PI
#define M_PI	3.1415926535897932384626
#endif

CParameter::CParameter(void)
{
	// Draw Instance

	PointRadiusForDrawing = 2;

	// Train Model

	Amount_TrainingIteration		= 3;
	Amount_InstanceForUpdating		= 10;

	// Go

	epsilon	= 1e-6;

	SetColors();

	LeafBinCount			= 50;
	RegionBinCount			= 50;

	// NMS
	m_fMaxOriDiff_NMS		= M_PI / 6;
	m_fLeafOriDiff_NMS		= M_PI / 8;
	m_fMaxScale_NMS			= 1.25;
	m_fMinScale_NMS			= 0.80;
	m_fLeafArea_NMS			= 5.00;
	m_NearArea_NMS.resize(6);
	m_NearArea_NMS[0]		= 5.0;
	m_NearArea_NMS[1]		= 5.0;
	m_NearArea_NMS[2]		= 5.0;
	m_NearArea_NMS[3]		= 5.0;
	m_NearArea_NMS[4]		= 5.0;
	m_NearArea_NMS[5]		= 5.0;
	m_MaxInstCount.resize(6);
	m_MaxInstCount[0]		= 200; // 64;
	m_MaxInstCount[1]		= 200; // 64;
	m_MaxInstCount[2]		= 200; // 64;
	m_MaxInstCount[3]		= 200; // 64;
	m_MaxInstCount[4]		= 200; // 64;
	m_MaxInstCount[5]		= 200; // 64;

	// Fill In Miss Nodes
	m_fMaxOriDiff_FillIn	= M_PI / 6;
	m_fMaxScale_FillIn		= 1.2;
	m_fMinScale_FillIn		= 0.8;
	m_NearArea_FillIn.resize(6);
	m_NearArea_FillIn[0]	= 5.0;
	m_NearArea_FillIn[1]	= 5.0;
	m_NearArea_FillIn[2]	= 5.0;
	m_NearArea_FillIn[3]	= 5.0;
	m_NearArea_FillIn[4]	= 5.0;
	m_NearArea_FillIn[5]	= 5.0;

	// Print Result
	strBottomUpCurveResult		= "CurveResult\\BottomUp";
	strTopDownCurveResult		= "CurveResult\\TopDown";
	strParseGroundPathName		= "ParseGround";

	// Learning
	m_Recalls.resize(6);
	m_Recalls[0]	= 0.80;
	m_Recalls[1]	= 0.80;
	m_Recalls[2]	= 0.80;
	m_Recalls[3]	= 0.80;
	m_Recalls[4]	= 0.80;
	m_Recalls[5]	= 0.80;
}

CParameter::~CParameter(void)
{
}

void CParameter::SetColors()
{
	Colors.clear();
	Colors.push_back(Color(255, 64,  0));
	Colors.push_back(Color(255,128,  0));
	Colors.push_back(Color(255,192,  0));
	Colors.push_back(Color(255,255,  0));
	Colors.push_back(Color(192,255,  0));
	Colors.push_back(Color(128,255,  0));
	Colors.push_back(Color( 64,255,  0));
	Colors.push_back(Color(  0,255,  0));
	Colors.push_back(Color(  0,255,  0));
	Colors.push_back(Color(  0,255, 64));
	Colors.push_back(Color(  0,255,128));
	Colors.push_back(Color(  0,255,192));
	Colors.push_back(Color(  0,255,255));
	Colors.push_back(Color(  0,192,255));
	Colors.push_back(Color(  0, 64,255));
	Colors.push_back(Color(  0,  0,255));
	Colors.push_back(Color( 64,  0,255));
	Colors.push_back(Color(128,  0,255));
	Colors.push_back(Color(192,  0,255));
	Colors.push_back(Color(255,  0,255));
	Colors.push_back(Color(255,  0,192));
	Colors.push_back(Color(255,  0,128));
	Colors.push_back(Color(255,  0, 64));
	Colors.push_back(Color(255,  0,  0));
}